<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>作业4</title>
    <script type="text/javascript">
        function Add(){
            document.bgColor = "white";
        }
        function chang(c){
            document.bgColor = c;
        }
    </script>
    <style>
        #a{
            margin-left: 200px;
        }
        #b{
            margin-left: 200px;
        }
        #c{
            margin-left: 200px;
        }
    </style>
</head>
<body>
    <div onload="Add()">
        <input type="button" value="变为红色" id="a" onclick="chang('red')" />   
        <input type="button" value="变为蓝色" id="b" onclick="chang('blue')" />
        <input type="button" value="变为绿色" id="c" onclick="chang('green')" />
    </div>
</body>
</html>